package cn.com.gzheroli.rabbitmq.listener;

import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import cn.com.gzheroli.bfw.pojo.base.TSLogLogin;
import cn.com.gzheroli.core.common.service.CommonService;

@Component
public class AsyncReplyQueueLitener {
    private Logger logger = LoggerFactory.getLogger(AsyncReplyQueueLitener.class);
    @Autowired
    private CommonService commonService;
    
    //参数中使用@Header获取mesage
    @RabbitListener(queues = { "ccs.queue.async.reply", "ccs.queue.bds.reply", "ccs.queue.etl.reply" })
    public void asyncReply(Map response) {
    	String message=response.get("message")==null?"":response.get("message").toString();
        logger.debug(message);
       // ccsQtrtzLogService.updateExecResultById(response.getMsg(), response.isSuccess());
    }
    
    @RabbitListener(queues = { "ccs.queue.log.reply" })
    public void asyncLogReply(Map logObj) {
    	//commonService.save(logObj.get("logObj"));
       // ccsQtrtzLogService.updateExecResultById(response.getMsg(), response.isSuccess());
    }
    
    @RabbitListener(queues = { "ccs.queue.msg.reply" })
    public void asyncMsgReply(Map logObj) {
    	//commonService.save(logObj.get("logObj"));
       // ccsQtrtzLogService.updateExecResultById(response.getMsg(), response.isSuccess());
    }
}
